@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap");

:root { 
  --primary-color: #4a90e2;
  --secondary-color: #f39c12;
  --background-color: #f0f2f5;
  --text-color: #333;
  --card-background: #ffffff;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.header {
  padding: 20px 20px;
  background-color: #3f51b5;
  margin-bottom: 10px;

  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header h1 {
  color: #ffffff;
  margin: 0 0 0 0;
  font-size: 24px;
  font-weight: bold;
}

.search-container {
  display: flex;
  justify-content: center;
}

#search {
  width: 300px;
  padding: 12px 20px;
  font-size: 16px;
  border: none;
  border-radius: 30px;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#search:focus {
  outline: none;
  box-shadow: 0 0 15px var(--secondary-color);
  width: 350px;
}

.container {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.main-content {
  display: flex;
  gap: 30px;
  width: 100%;
  padding: 20px;
}

.sidebar {
  width: 280px;
  background-color: #ffffff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  transition: all 0.3s ease;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

.sidebar:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

#favNav ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

#favNav li {
  margin-bottom: 5px;
}

#favNav h3 {
  font-size: 14px;
  color: #333;
  margin: 0;
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

#favNav h3:hover {
  background-color: #f0f4f8;
  color: var(--primary-color);
}

#favNav .level-1 {
  font-weight: 600;
  font-size: 16px;
  margin-top: 15px;
}

#favNav .level-2 {
  padding-left: 25px;
  font-weight: 500;
}

#favNav .level-3 {
  padding-left: 35px;
  font-weight: 400;
  font-size: 13px;
  color: #666;
}

#favNav .level-1::before {
  content: "▸";
  margin-right: 8px;
  transition: transform 0.2s ease;
}

#favNav .level-1:hover::before {
  transform: translateX(3px);
}

#favNav .level-2::before {
  content: "•";
  margin-right: 8px;
  color: var(--primary-color);
}

#favNav .level-3::before {
  content: "-";
  margin-right: 8px;
  color: #999;
}

/* 改进滚动条样式 */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.content {
  flex: 1;
  padding: 0 40px 0 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.site {
  border: none;
  border-bottom: 1px dashed #ccc;
  border-radius: 8px;
  padding: 15px;
  background-color: var(--card-background);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 50px;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
  cursor: pointer;
  /* 添加这行，使整个卡片看起来可点击 */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.site-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.site img {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
  object-fit: cover;
  transition: all 0.3s ease;
}

.site:hover img {
  transform: rotate(360deg);
}

.site h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.site a:hover {
  color: var(--primary-color);
}

.site p {
  margin: 0;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category {
  margin-bottom: 30px;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.category h2 {
  font-size: 18px;
  color: var(--primary-color);
  margin-bottom: 10px;
  padding-bottom: 5px;
  transition: all 0.3s ease;
}

.category-level-1 h2 {
  border-bottom: 2px dashed #aeaeae;
  /* 一级标题分割线为2px黑色 */
}

.category-level-2 h2 {
  color: var(--secondary-color);
  border-bottom: 1.5px solid var(--secondary-color);
  /* 二级标题分割线为2px橙色 */
}

.category-level-3 {
  margin-left: 20px;
}

.category-level-3 h2 {
  border-bottom: 1px solid var(--primary-color);
  /* 三级标题分割线为1px蓝色 */
}

.category-level-3 h2::before {
  content: " - ";
}

.category h2:hover {
  transform: translateX(10px);
  color: var(--secondary-color);
}